#pragma once
#include <string>
#include <vector>
#include <utility>

class IConfigParser {
public:
    virtual ~IConfigParser() = default;

    // 基础操作
    virtual bool LoadFromFile(const std::string& filePath) = 0;
    virtual bool SaveToFile(const std::string& filePath) = 0;
    virtual bool SaveToString(std::string& data) = 0;

    // 查询操作
    virtual const std::vector<std::string>& GetAllSections() const = 0;
    virtual const std::vector<std::string> GetSectionKeys(const std::string& section) const = 0;
    virtual std::string GetValue(const std::string& section, const std::string& key, const std::string& defaultValue = "") const = 0;

    // 修改操作
    virtual bool SetValue(const std::string& section, const std::string& key, const std::string& value) = 0;
    virtual bool DeleteKey(const std::string& section, const std::string& key, bool removeSectionIfEmpty = false) = 0;
    virtual bool DeleteSection(const std::string& section) = 0;
};